# Makefile
# Author : Edouard ROGE

CC=g++
CFLAGS= -Wall -Wextra -std=c++11
LIBS= -rdynamic -L/usr/local/lib -pthread -ldl -L../../lib -lcore -lmath
INCLUDES=-I.. -I../../include

PROJECT=MainTest
NAME=maintest
SRC_DIR=./
OBJ_DIR=../../obj/$(PROJECT)
BIN_DIR=../../bin

SRC_FILES=	main.cpp \
		Test/UnitTest.cpp \
		Test/MemoryTest.cpp \
		Test/URITest.cpp \
		Test/FileTest.cpp \
		Test/NotificationTest.cpp \
		Test/ThreadTest.cpp \
		Test/XMLTest.cpp \
		Test/PluginTest.cpp \
		Test/NetworkTest.cpp \
		Test/GUITest.cpp \
#		SpeedTest/SpeedTest.cpp \
#		SpeedTest/ArraySpeedTest.cpp \
#		SpeedTest/MemorySpeedTest.cpp \
			
OBJ_FILES=$(addprefix $(OBJ_DIR)/, $(SRC_FILES:.cpp=.o))

TARGET=$(BIN_DIR)/$(NAME)

release: CFLAGS += -O3
release:$(TARGET)
debug: CFLAGS += -DDEBUG -g
debug:$(TARGET)
all:$(TARGET)

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
	@echo -n "Compiling `basename $<` : "
	@$(CC) -c $< $(CFLAGS) $(INCLUDES) -o $@
	@echo "OK"

$(TARGET):$(OBJ_FILES)
	@echo -n "Creating `basename $@` : "
	@$(CC) $(OBJ_FILES) -o $(TARGET) $(LIBS)
	@echo "OK"

clean:
	@echo -n "$(PROJECT) : Deleting .o and library: "
	@rm -f $(OBJ_FILES)
	@rm -f $(TARGET)
	@echo "OK"
